package lili.com.my.activity;

import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.MediaController;
import android.widget.VideoView;

import lili.com.my.R;

public class VideoActivity extends AppCompatActivity {

    private VideoView videoView;
    private String videourl1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

        videourl1 = getIntent().getStringExtra("videourl");
        videoView = (VideoView) findViewById(R.id.vidaoView);
        videoView.setVideoURI(Uri.parse(videourl1));
        MediaController controller=new MediaController(this);
        videoView.setMediaController(controller);
        videoView.start();
    }
}
